package game.games.rpg;

import game.gfx.ColoredChar;
import game.gfx.Colors;
import game.gfx.ConsoleColor;
import game.unicode.BlockElements;

public class Door extends AbstractColoredCharRenderer
{
    private boolean open   = false;
    private boolean locked = false;
    
    public Door()
    {
        super(Room.DOOR, ConsoleColor.DEFAULT);
    }
    
    public boolean isOpen()
    {
        return open;
    }
    
    public void setOpen(boolean open)
    {
        this.open = open;
    }
    
    public boolean isLocked()
    {
        return locked;
    }
    
    public void setLocked(boolean locked)
    {
        this.locked = locked;
    }
    
    @Override
    public ColoredChar getChar()
    {
        ColoredChar c = super.getChar();
        if (isOpen())
        {
            c.setChar(BlockElements.BLOCK_25);
            c.setConsoleColor(new ConsoleColor(Colors.dark_gray, Colors.black));
        }
        else
        {
            c.setConsoleColor(new ConsoleColor(Colors.light_gray, Colors.black));
        }
        return c;
    }
    
}
